﻿using AutoMapper;
using GroceryList.Domain.Model.GroceryList;
using GroceryList.Domain.Model.Product;
using GroceryList.Front.Web.ViewModels;

namespace GroceryList.Front.Web.Installers
{
    public class AutomapperConfiguration:Profile
    {
        protected override void Configure()
        {
            Mapper.CreateMap<Producto, string>().ConvertUsing(p => p == null ? string.Empty : p.Nombre);
            Mapper.CreateMap<Producto, ProductoDto>();

            Mapper.CreateMap<ListaCompra, ListaCompraSimpleDto>();
            Mapper.CreateMap<ListaCompra, ListaCompraDto>();
            Mapper.CreateMap<DetalleProducto, DetalleDto>();
        }
    }
}